/* 便签容器样式 */
.sticky-notes-container {
    width: 90%;
    max-width: 800px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
}

/* 头部左侧布局 */
.todo-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

/* 搜索容器 */
.sticky-search-container {
    position: relative;
    flex: 1;
    max-width: 300px;
}

/* 搜索输入框 */
.sticky-search-input {
    width: 100%;
    padding: 6px 28px 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
}

.sticky-search-input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

/* 清除搜索按钮 */
.sticky-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    display: none;
    padding: 0;
    line-height: 1;
}

.sticky-search-clear:hover {
    color: #666;
}

/* 无搜索结果提示 */
.sticky-notes-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
    background: white;
    border-radius: 8px;
    border: 1px dashed rgba(0, 0, 0, 0.1);
}

.sticky-notes-wrapper {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fafafa;
    overscroll-behavior: contain;
}

/* 新增便签按钮 */
.add-sticky-note-button {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 2px dashed #4CAF50;
    border-radius: 8px;
    background: white;
    color: #4CAF50;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-sticky-note-button:hover {
    background: #f0f9f0;
    transform: translateY(-1px);
}

/* 便签列表 */
.sticky-notes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    overscroll-behavior: contain;
}

/* 便签卡片 */
.sticky-note-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 150px;
    padding: 16px 16px 16px 16px;
}

.sticky-note-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* 已保存的便签卡片 */
.sticky-note-card.saved {
    padding: 16px 16px 0 16px;
}

/* 便签内容 */
.sticky-note-content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    word-break: break-word;
    flex: 1;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

/* 便签元信息 */
.sticky-note-meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

/* 便签操作按钮 */
.sticky-note-actions {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border-top: 1px solid #eee;
    margin-top: auto;
    margin-left: -16px;
    margin-right: -16px;
    margin-bottom: -16px;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.sticky-note-save,
.sticky-note-cancel {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sticky-note-save {
    background: #4CAF50;
    color: white;
}

.sticky-note-save:hover {
    background: #45a049;
}

.sticky-note-cancel {
    background: #f0f0f0;
    color: #666;
}

.sticky-note-cancel:hover {
    background: #e8e8e8;
}

/* 已保存便签的操作按钮 */
.sticky-note-card.saved .sticky-note-actions {
    position: static;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #eee;
    opacity: 1;
    margin-top: auto;
}

.sticky-note-copy,
.sticky-note-edit,
.sticky-note-delete {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sticky-note-copy:hover {
    color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
}

.sticky-note-edit:hover {
    color: #FFA500;
    background: rgba(255, 165, 0, 0.1);
}

.sticky-note-delete:hover {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.08);
}

/* 新建便签卡片 */
.sticky-note-card.new {
    border: 1px solid #4CAF50;
    animation: slideDown 0.3s ease-out;
}

/* 便签输入框 */
.sticky-note-input {
    width: 100%;
    flex: 1;
    min-height: 100px;
    padding: 16px;
    border: none;
    font-size: 14px;
    line-height: 1.6;
    font-family: inherit;
    outline: none;
    resize: none;
}

/* 空状态和错误状态 */
.sticky-notes-empty,
.sticky-notes-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
    background: white;
    border-radius: 8px;
    border: 1px dashed rgba(0, 0, 0, 0.1);
}

.sticky-notes-error {
    color: #ff4444;
    border-color: rgba(255, 68, 68, 0.2);
}

/* 删除动画 */
.sticky-note-card.deleting {
    animation: fadeOut 0.3s ease-out forwards;
}

/* 编辑状态的卡片样式 */
.sticky-note-card.editing {
    border-color: #FFA500;
    box-shadow: 0 0 0 2px rgba(255, 165, 0, 0.1);
}

/* 编辑状态的输入框 */
.sticky-note-card.editing .sticky-note-content {
    display: none;
}

.sticky-note-edit-input {
    width: 100%;
    flex: 1;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    outline: none;
    background: #fff;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

/* 编辑操作按钮容器 */
.sticky-note-edit-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #eee;
    margin-top: auto;
}

.sticky-note-edit-save,
.sticky-note-edit-cancel {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sticky-note-edit-save {
    background: #4CAF50;
    color: white;
}

.sticky-note-edit-save:hover {
    background: #45a049;
}

.sticky-note-edit-cancel {
    background: #f0f0f0;
    color: #666;
}

.sticky-note-edit-cancel:hover {
    background: #e8e8e8;
}

/* 便签颜色按钮组 */
.sticky-note-colors {
    display: flex;
    gap: 4px;
    margin-right: 8px;
}

.sticky-note-color-btn {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.sticky-note-color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sticky-note-color-btn.selected {
    border: 2px solid #4CAF50;
    transform: scale(1.1);
}

/* 调整便签操作按钮区域的布局 */
.sticky-note-actions {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border-top: 1px solid #eee;
    margin-top: auto;
    margin-left: -16px;
    margin-right: -16px;
    margin-bottom: 0px;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* 便签卡片 */
.sticky-note-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 150px;
    padding: 16px 16px 16px 16px;
}

/* 便签内容 */
.sticky-note-content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    word-break: break-word;
    flex: 1;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

/* 便签元信息 */
.sticky-note-meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}